package com.ruoyi.performance.service.impl;

import java.math.BigDecimal;
import java.util.List;

import cn.hutool.core.bean.BeanUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.performance.mapper.AssessmentScoringMapper;
import com.ruoyi.performance.domain.AssessmentScoring;
import com.ruoyi.performance.service.IAssessmentScoringService;

/**
 * 考核打分Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-03-23
 */
@Service
public class AssessmentScoringServiceImpl implements IAssessmentScoringService 
{
    @Autowired
    private AssessmentScoringMapper assessmentScoringMapper;

    /**
     * 查询考核打分
     * 
     * @param id 考核打分主键
     * @return 考核打分
     */
    @Override
    public AssessmentScoring selectAssessmentScoringById(Long id)
    {
        return assessmentScoringMapper.selectAssessmentScoringById(id);
    }

    /**
     * 查询考核打分列表
     * 
     * @param assessmentScoring 考核打分
     * @return 考核打分
     */
    @Override
    public List<AssessmentScoring> selectAssessmentScoringList(AssessmentScoring assessmentScoring)
    {
        return assessmentScoringMapper.selectAssessmentScoringList(assessmentScoring);
    }

    /**
     * 新增考核打分
     * 
     * @param assessmentScoring 考核打分
     * @return 结果
     */
    @Override
    public int insertAssessmentScoring(AssessmentScoring assessmentScoring)
    {
        return assessmentScoringMapper.insertAssessmentScoring(assessmentScoring);
    }

    /**
     * 修改考核打分
     * 
     * @param assessmentScoring 考核打分
     * @return 结果
     */
    @Override
    public int updateAssessmentScoring(AssessmentScoring assessmentScoring)
    {
        return assessmentScoringMapper.updateAssessmentScoring(assessmentScoring);
    }

    /**
     * 批量删除考核打分
     * 
     * @param ids 需要删除的考核打分主键
     * @return 结果
     */
    @Override
    public int deleteAssessmentScoringByIds(Long[] ids)
    {
        return assessmentScoringMapper.deleteAssessmentScoringByIds(ids);
    }

    /**
     * 删除考核打分信息
     * 
     * @param id 考核打分主键
     * @return 结果
     */
    @Override
    public int deleteAssessmentScoringById(Long id)
    {
        return assessmentScoringMapper.deleteAssessmentScoringById(id);
    }

    @Override
    public void examineScoring(AssessmentScoring assessmentScoring) {
        Long id = assessmentScoring.getId();
        AssessmentScoring assessmentScoring1 = assessmentScoringMapper.selectAssessmentScoringById(id);
        BeanUtil.copyProperties(assessmentScoring,assessmentScoring1);
        assessmentScoring1.setReviewNameId("刚子哥");
        assessmentScoring1.setReviewStatus(1L);
        assessmentScoringMapper.updateAssessmentScoring(assessmentScoring1);
    }
}
